package com.fs.erp.api.basedata.entity;

import java.io.Serializable;
import lombok.Data;

/**
 * 商品SPU和商品属性关系表
 * @TableName base_data_product_poly_property
 */
@Data
public class ProductPolyProperty implements Serializable {
    /**
     * ID
     */
    private String id;

    /**
     * 商品聚合ID
     */
    private String polyId;

    /**
     * 商品属性ID
     */
    private String propertyId;

    /**
     * 属性值ID
     */
    private String propertyItemId;

    /**
     * 商品属性值
     */
    private String propertyText;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductPolyProperty other = (ProductPolyProperty) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPolyId() == null ? other.getPolyId() == null : this.getPolyId().equals(other.getPolyId()))
            && (this.getPropertyId() == null ? other.getPropertyId() == null : this.getPropertyId().equals(other.getPropertyId()))
            && (this.getPropertyItemId() == null ? other.getPropertyItemId() == null : this.getPropertyItemId().equals(other.getPropertyItemId()))
            && (this.getPropertyText() == null ? other.getPropertyText() == null : this.getPropertyText().equals(other.getPropertyText()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPolyId() == null) ? 0 : getPolyId().hashCode());
        result = prime * result + ((getPropertyId() == null) ? 0 : getPropertyId().hashCode());
        result = prime * result + ((getPropertyItemId() == null) ? 0 : getPropertyItemId().hashCode());
        result = prime * result + ((getPropertyText() == null) ? 0 : getPropertyText().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", polyId=").append(polyId);
        sb.append(", propertyId=").append(propertyId);
        sb.append(", propertyItemId=").append(propertyItemId);
        sb.append(", propertyText=").append(propertyText);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}